<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html>
<html>
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="./css/all.css">
<link rel="stylesheet" href="./css/nav.css">
<link rel="stylesheet" href="./css/table.css">
<style>
	a{
		text-decoration: none;
		color: black;
	}
</style>
<head>
<meta charset="UTF-8">
<title>Personal Space</title>

</head>
<body>
	<nav id="navbar">
		<h1 class="logo">
			<spna class="text-primary">
				<i class="fas fa-book-open"style="color: #93cb52"></i></spna>
				 个人中心

		</h1>
		<ul>
			<li>你好,${loginEntity.username}</li>
			<li><a href="actionSpace_showSpace.action">个人空间</a></li>

		</ul>

	</nav>
	<c:choose>
                   <c:when test="${loginEntity.type  eq 'student'}">
						<a href="actionSpace_getStudentInfo">个人信息</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 1}">
							学号:${studentEntity.studentNo}<br>
							姓名:${studentEntity.studentName}<br>
							年级:${studentEntity.studentGrade} 级<br>
							学院:${studentEntity.studentDepartment}<br>
							专业:${studentEntity.studentMajor}<br>
							</c:when>
						</c:choose>
						<a href="actionSpace_getStudentScore">个人成绩</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 2}">
								<table>
									<tr>
										<th>课程代码</th>
										<th>课程名称</th>
										<th>任课老师</th>
										<th>分数</th>
									</tr>
									<s:iterator value="studentScoreEntities" var="ss">
										<tr>
											<td>${ss.courseNo}</td>	
											<td>${ss.courseName}</td>
											<td>${ss.teacherNo}</td>
											<td>${ss.score}</td>
										</tr>
									</s:iterator>
								</table>
							</c:when>
						</c:choose>
						<a href="actionSpace_getSchedule">查询课表</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 3}">
								<table>
									<tr>
										<th>课程代码</th>
										<th>课程名称</th>
										<th>任课老师</th>
										<th>课程信息简介</th>
									</tr>
									<s:iterator value="studentCourseEntities" var="sc">
										<tr>
											<td>${sc.courseNo}</td>	
											<td>${sc.courseName}</td>
											<td>${sc.teacherNo}</td>
											<td>${sc.courseInfo}</td>
										</tr>
									</s:iterator>
								</table>
							</c:when>
						</c:choose>
						<a href="actionSpace_gotoCourseSelectSys">选课系统</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 4}">
								<table>
									<tr>
										<th>课程代码</th>
										<th>课程名称</th>
										<th>任课老师</th>
										<th>课程信息简介</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="studentCourseEntities" var="sc">
										<tr>
											<td>${sc.courseNo}</td>	
											<td>${sc.courseName}</td>
											<td>${sc.teacherNo}</td>
											<td>${sc.courseInfo}</td>
											<td><a href="actionSpace_studentChoiceCourse?courseEntity.courseNo=${sc.courseNo}&courseEntity.teacherNo=${sc.teacherNo}">选课</a></td>
										</tr>
									</s:iterator>
								</table>
							</c:when>
						</c:choose>
						<a href="actionSpace_gotoFriendsCircle">毕业生朋友圈</a><br>
							<c:choose>
							<c:when test="${loginEntity.currentTask  eq 5}">
							<h3>Show</h3>
							</c:when>
							</c:choose>
                   </c:when>
                   
                   <c:when test="${loginEntity.type  eq 'teacher'}">
                   		<a href="actionSpace_getTeacherInfo">教师信息</a><br>
                   		<c:choose>
							<c:when test="${loginEntity.currentTask  eq 1}">
							学号:${teacherEntity.teacherNo}<br>
							姓名:${teacherEntity.teacherName}<br>
							学院:${teacherEntity.teacherDepartment}<br>
								<table>
									<tr>
										<th>课程代码</th>
										<th>课程名称</th>
										<th>课程信息简介</th>
									</tr>
									<s:iterator value="teacherCourseEntities" var="tcs">
										<tr>
											<td>${tcs.courseNo}</td>	
											<td>${tcs.courseName}</td>
											<td>${tcs.courseInfo}</td>
										</tr>
									</s:iterator>
								</table>
							</c:when>
						</c:choose>
						<a href="actionSpace_gotoCourseSetting">授课信息</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 2}">
								<table>
									<tr>
										<th>课程代码</th>
										<th>课程名称</th>
										<th>课程信息简介</th>
										<th>是否开课</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="teacherCourseEntities" var="tcs">
										<tr>
											<td>${tcs.courseNo}</td>	
											<td>${tcs.courseName}</td>
											<td>${tcs.courseInfo}</td>
											<td>${tcs.select_enable}</td>
											<td><a href="actionSpace_teacherSettingCourse?courseEntity.courseNo=${tcs.courseNo}&courseEntity.select_enable=true">开课</a> <a href="actionSpace_teacherSettingCourse?courseEntity.courseNo=${tcs.courseNo}&courseEntity.select_enable=false">取消开课</a></td><br>
										</tr>
									</s:iterator>
								</table>
							</c:when>
						</c:choose>
                   </c:when>
                   
                   <c:otherwise>
                   		<a href="actionSpace_announceManage">管理公告</a>
                   		<c:choose>
							<c:when test="${loginEntity.currentTask  eq 1}">
								<table>
									<tr>
										<th>文件名称</th>
										<th>公告类型</th>
										<th>发布日期</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="storedFileEntities" var="sfs">
										<tr>
											<td><a href="${sfs.fileLocation}">${sfs.fileName}</a></td>	
											<td>${sfs.fileType}</td>
											<td>${sfs.releaseTime}</td>
											<td><a href="actionSpace_deleteAnnounce?fileEntity.fileName=${sfs.fileName}">删除</a></td><br>
										</tr>
									</s:iterator>
								</table>
								<a href="actionSpace_addAnnounce">添加公告</a><br>
							</c:when>
						</c:choose>
						<a href="actionSpace_depmajManage">学院、专业管理</a>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 2}">
								<table>
									<tr>
										<th>学院代码</th>
										<th>学院名称</th>
										<th>包含专业</th>
										<th>专业代码</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="depatmentEntities" var="dpm">
										<s:iterator value="majorEntities" var="mjr">
											<c:choose>
											<c:when test="${mjr.departmentNo eq dpm.departmentNo}">
											<tr>
												<td>${dmp.departmentNo}</td>	
												<td>${dmp.departmentName}</td>	
												<td>${mjr.majorName}</td>
												<td>${mjr.majorNo}</td>
												<td><a href="actionSpace_deleteMajor?majorentity.majorNo=${mjr.majorNo}">删除</a> <a href="actionSpace_updateMajor">修改</a> </td><br>
											</tr>
											</c:when>
											</c:choose>
										</s:iterator>
									</s:iterator>
								</table>
								<a href="actionSpace_gotoDepartmentAddPage.action">添加学院</a>  <a href="actionSpace_gotoMajorAddPage.action">添加专业</a><br>
							</c:when>
						</c:choose>
						<a href="actionSpace_studentManage">学生管理</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 3}">
								<table>
									<tr>
										<th>学号</th>
										<th>姓名</th>
										<th>年级</th>
										<th>学院</th>
										<th>专业</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="studentEntities" var="sts">
										<tr>
											<td>${sts.studentNo}</td>
											<td>${sts.studentName}</td>
											<td>${sts.studentGrade}</td>
											<td>${sts.studentDepartment}</td>
											<td>${sts.studentMajor}</td>
											<td><a href="actionSpace_deleteStudent?studentEntity.studentNo=${sts.studentNo}">删除</a> <a href="detail?studentEntity.stuNo=${tcs.courseNo}">修改</a> </td><br>
										</tr>
									</s:iterator>
								</table>
								<a href="actionSpace_gotoStudentAddPage.action">添加学生</a><br>
							</c:when>
						</c:choose>
						<a href="actionSpace_teacherManage">教师管理</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 4}">
								<table>
									<tr>
										<th>教师编号</th>
										<th>姓名</th>
										<th>学院</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="teacherEntities" var="tcs">
										<tr>
											<td>${tcs.teacherNo}</td>
											<td>${tcs.teacherName}</td>
											<td>${tcs.teacherDepartment}</td>
											<td><a href="actionSpace_deleteTeacher?teacherEntity.teacherNo=${tcs.teacherNo}">删除</a> <a href="detail?studentEntity.stuNo=${tcs.teacherNo}">修改</a> </td><br>
										</tr>
									</s:iterator>
								</table>
								<a href="actionSpace_gotoTeacherAddPage.action">添加教师</a><br>
							</c:when>
						</c:choose>
						<a href="actionSpace_courseManage">课程管理</a><br>
						<c:choose>
							<c:when test="${loginEntity.currentTask  eq 5}">
								<table>
									<tr>
										<th>课程代码</th>
										<th>课程名称</th>
										<th>任课教师代码</th>
										<th>授课专业</th>
										<th>课程安排</th>
										<th colspan="2">操作</th>
									</tr>
									<s:iterator value="courseEntities" var="crs">
										<tr>
											<td>${crs.courseNo}</td>
											<td>${crs.courseName}</td>
											<td>${crs.teacherNo}</td>
											<td>${crs.majorNo}</td>
											<td>${crs.courseInfo}</td>
											<td><a href="actionSpace_deleteCourse?courseEntity.courseNo=${crs.courseNo}">删除</a> <a href="detail?studentEntity.stuNo=${crs.courseNo}">修改</a> </td><br>
										</tr>
									</s:iterator>
								</table>
								<a href="actionSpace_gotoCourseAddPage.action">添加课程</a><br>
							</c:when>
						</c:choose>
                   </c:otherwise>
	</c:choose>
</body>
</html>